<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>第一个thymeleaf程序</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<p th:text="'Hello, ' + ${xname} + '!'" />
<div>1234567890!!!xx</div>

<div class="panel panel-warning">
    <div class="panel-heading">hello</div>
    <div id="usernamediv" class="panel-body"></div>
</div>
<script th:inline="javascript">
    $(function(){
        $.ajax({
            url:"/thymeleaf/ajax",
            data:{
                username:"xxx"
            },
            type:"get",
            dataType:"text",
            success:function(text){
                alert(text);
                $("#usernamediv").text(text);
            }
        });
    });
</script>
</body>
</html>